package com.zzyy.dtx.msg.controller;

import com.zzyy.dtx.msg.api.MsgApi;
import com.zzyy.dtx.msg.dto.MsgDTO;
import com.zzyy.dtx.msg.service.MsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


@RestController
public class MsgController  implements MsgApi
{
    @Resource
    private MsgService msgService;

    /**
     * 设计图第2步，接收"待发送"消息，把消息保持为“待发送”状态
     * @param msgDTO
     */
    public  void prepareMsg(MsgDTO msgDTO){
        this.msgService.prepareMsg(msgDTO);
    }

    /**
     * 设计图第5步，确认消息可以发送了，把消息状态改为“已发送”
     * @param msgDTO
     */
    public  void confirmMsg(MsgDTO msgDTO){
        this.msgService.confirmMsg(msgDTO);
    }

    /**
     * 设计图第9步，删除消息
     * @param msgDTO
     */
    public  void deleteMsg(MsgDTO msgDTO){
        this.msgService.deleteMsg(msgDTO);
    }



}
